package com.xmy.study.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.study.entity.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程表 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2023-09-08
 */
@Mapper
public interface CourseMapper extends BaseMapper<Course> {
    @Select("select id from edu_course ${ew.customSqlSegment}")
    public List<String> selectId(@Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select("select name from edu_version where id = #{id}")
    public String getVersionName(@Param("id") Long id);

    @Select("select name from edu_class_type where id = #{id}")
    public String getClassTypeName(@Param("id") Long id);

    @Select("select name from edu_period where id = #{id}")
    public String getPeriodName(@Param("id") Long id);
}
